package com.bolang.onlycode.demo.configuratin;

import com.bolang.onlycode.demo.job.JobTest;
import org.quartz.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class quartzConfig {
//    @Bean
//    public JobDetail jobTestDetail(){
//        JobDetail jobTestDetail= JobBuilder.newJob(JobTest.class).
//                withIdentity("JobTestDetail","JobTets")
//                .storeDurably()//即使没有Trigger关联时，也不需要删除该JobDetail
//                .build();
//           return  jobTestDetail;
//    }
//   @Bean
//    public Trigger JobTestTrigger(){
//       CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule("*/100 * * * * ?");
//       Trigger trigger = TriggerBuilder.newTrigger()
//               .forJob(jobTestDetail())//关联上述的JobDetail
//               .withIdentity("JobTestTrigger","jonTestTrigger")//给Trigger起个名字
//               .withSchedule(cronScheduleBuilder)
//               .build();
//       return trigger;
//   }

}
